﻿using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using Refract.Composition;
using Refract.Extensions;
using Refract.MVVM;

namespace Refract.ReferenceApplication.Module1
{    
    public class Module1Controller : IModuleController
    {
        [Import]
        public CompositionContainer CompositionContainer { get; set; }

        public IView PersonList(int x, int y, int z)
        {
            IView view = CompositionContainer.ExportNewValue<IView, View1>();

            var viewModel = view.GetViewModel<IDataContainer<string>>();
            viewModel.SetData("Hello");
            return view;
        }
    }
}
